package com.carrie.mdg.myviewtext.fragments;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.carrie.mdg.myviewtext.R;

/**
 * A simple {@link Fragment} subclass.
 */
public class NewsContentFragment extends Fragment {
    private TextView title, content;
    private LinearLayout layout;


    public NewsContentFragment() {
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_news_content, container, false);
        title = (TextView) view.findViewById(R.id.new_title);
        content = (TextView) view.findViewById(R.id.news_content);
        layout = (LinearLayout) view.findViewById(R.id.ll_layout);
        return view;
    }

    public void refresh(String newsTitle, String newsContent) {
        layout.setVisibility(View.VISIBLE);
        title.setText(newsTitle);
        content.setText(newsContent);
    }

}
